#pragma once

#include <vector>
#include "globals.h"
#include "Vector.h"

class Site
{
public:
	Site() : isPoint_(true),id_(-1) {}
	Site(const Vector& p) : isPoint_(true),id_(-1),p0_(p) {}
	Site(int id, const Vector& p) : isPoint_(true),id_(id),p0_(p) {}
	Site(int id, const Vector& p0, const Vector& p1) : isPoint_(false),id_(id),p0_(p0),p1_(p1) {}



	//edit by lqw
	Site(double x,double y);
	int isAboveOf(const Site& site) const;

	bool isPoint_;
	int id_;
	Vector p0_;
	Vector p1_;
};

class Graph
{
public:
	
	double getWidth() const { return width_; }
	double getHeight() const { return height_; }

	void setSize(double w, double h);
	// add point to the graph, automatically generate other information
	bool addPoint( const Vector &point );
	bool addSegment(Vector p0, Vector p1);

	void addRandomPoints(int count);

	//added by lqw
	void addRandomPoints(int count, unsigned int p_iRandSeed);

	// get points information
	int getSiteCount() const;
	Site getSite( int id ) const;
	std::vector<Site>& getSites();

protected:
	double width_;
	double height_;
	std::vector<Site>	sites_;

};

